﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace YayiMgr.EntityFrameworkCore.Migrations
{
    /// <inheritdoc />
    public partial class _02 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "Suppliers",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    SupplierName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false, comment: "供应商名称")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    ContactName = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false, comment: "联系人姓名")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    ContactTitle = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "联系人职位")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Address = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true, comment: "地址")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    PostalCode = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "邮政编码")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Phone = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false, comment: "联系电话")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Fax = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "传真号码")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Email = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "电子邮箱")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Website = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true, comment: "网站地址")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    TaxID = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "税务登记号")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    BankAccount = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true, comment: "银行账户信息")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    PaymentTerms = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true, comment: "付款条款")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    CreditLimit = table.Column<int>(type: "int", nullable: true, comment: "信用额度"),
                    Rating = table.Column<int>(type: "int", nullable: true, comment: "供应商评级"),
                    Notes = table.Column<string>(type: "longtext", nullable: true, comment: "备注")
                        .Annotation("MySql:CharSet", "utf8mb4")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Suppliers", x => x.Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Suppliers");
        }
    }
}
